package com.cencat.order.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 订单发货VO
 * @author cencat
 * @description 固定商家场景多租户SaaS企业综合管理系统订单发货VO
 * @since 2024-01-01
 */
@Data
@Accessors(chain = true)
@Schema(name = "OrderShippingVO", description = "订单发货VO")
public class OrderShippingVO implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "配送方式：EXPRESS-快递配送，SELF_PICKUP-自提")
    @NotBlank(message = "配送方式不能为空")
    @Pattern(regexp = "^(EXPRESS|SELF_PICKUP)$", message = "配送方式不正确")
    private String shippingMethod;

    @Schema(description = "物流公司")
    @NotBlank(message = "物流公司不能为空")
    @Size(max = 100, message = "物流公司长度不能超过100个字符")
    private String shippingCompany;

    @Schema(description = "物流单号")
    @NotBlank(message = "物流单号不能为空")
    @Size(max = 100, message = "物流单号长度不能超过100个字符")
    private String shippingNo;

    @Schema(description = "实际配送费用")
    @DecimalMin(value = "0.00", message = "实际配送费用不能为负数")
    @Digits(integer = 10, fraction = 2, message = "实际配送费用格式不正确")
    private BigDecimal actualShippingFee;

    @Schema(description = "包裹重量(克)")
    @DecimalMin(value = "0.00", message = "包裹重量不能为负数")
    @Digits(integer = 10, fraction = 2, message = "包裹重量格式不正确")
    private BigDecimal packageWeight;

    @Schema(description = "包裹体积(立方厘米)")
    @DecimalMin(value = "0.00", message = "包裹体积不能为负数")
    @Digits(integer = 10, fraction = 2, message = "包裹体积格式不正确")
    private BigDecimal packageVolume;

    @Schema(description = "包裹数量")
    @Min(value = 1, message = "包裹数量必须大于0")
    private Integer packageCount;

    @Schema(description = "发货仓库")
    @Size(max = 100, message = "发货仓库长度不能超过100个字符")
    private String warehouse;

    @Schema(description = "发货人")
    @Size(max = 100, message = "发货人长度不能超过100个字符")
    private String shipper;

    @Schema(description = "发货联系电话")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "发货联系电话格式不正确")
    private String shipperPhone;

    @Schema(description = "预计送达时间(小时)")
    @Min(value = 1, message = "预计送达时间必须大于0")
    private Integer estimatedDeliveryHours;

    @Schema(description = "配送备注")
    @Size(max = 500, message = "配送备注长度不能超过500个字符")
    private String shippingRemark;

    @Schema(description = "是否保价：0-不保价，1-保价")
    @Min(value = 0, message = "是否保价值不正确")
    @Max(value = 1, message = "是否保价值不正确")
    private Integer isInsured;

    @Schema(description = "保价金额")
    @DecimalMin(value = "0.00", message = "保价金额不能为负数")
    @Digits(integer = 10, fraction = 2, message = "保价金额格式不正确")
    private BigDecimal insuredAmount;

    @Schema(description = "是否代收货款：0-否，1-是")
    @Min(value = 0, message = "是否代收货款值不正确")
    @Max(value = 1, message = "是否代收货款值不正确")
    private Integer isCashOnDelivery;

    @Schema(description = "代收金额")
    @DecimalMin(value = "0.00", message = "代收金额不能为负数")
    @Digits(integer = 10, fraction = 2, message = "代收金额格式不正确")
    private BigDecimal cashOnDeliveryAmount;

    @Schema(description = "配送服务类型：STANDARD-标准配送，EXPRESS-加急配送，SAME_DAY-当日达")
    @Pattern(regexp = "^(STANDARD|EXPRESS|SAME_DAY)$", message = "配送服务类型不正确")
    private String serviceType;

    @Schema(description = "配送时效要求")
    @Size(max = 100, message = "配送时效要求长度不能超过100个字符")
    private String deliveryRequirement;
}